﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>JS Console - Example</title>
	<link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console">
	</div>
	<script src="scripts/js-console.js">	
	</script>
	<script>
		var person = {
			firstname: "Doncho",
			lastname: "Minkov",
			toString: function () {
				return this.firstname + " " + this.lastname;
			}
		}

		//var person = new Object();
		//person.firstname = "Doncho";
		//person.lastname = "Minkov";
		//person.toString = function () {
		//	return this.firstname + " " + this.lastname;
		//}

		function renamePerson(personObj, fname, lname) {
			personObj.firstname = fname || personObj.firstname;
			personObj.lastname = lname || personObj.lastname;
		}

		jsConsole.writeLine(person);
		renamePerson(person, "Stamat");
		jsConsole.writeLine(person);
	</script>
</body>
</html>
